<!DOCTYPE html>
<html>
<head>
    <title>打印</title>
    <meta charset="utf-8">
    <style>
        .printBox {

        }
        .button1{
            color: #fff;
            background-color: #1890ff;
            border-color: #1890ff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
            -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
            box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);height: 32px;padding: 0 15px;font-size: 14px;border-radius: 4px;
            margin-left: 45%;
            margin-top: 30px;
        }

    </style>
    <!-- 打印的样式-->
    <style media="print">
        @page {

        }
    </style>
    <script src="/jquery-3.6.0.min.js"></script>
    <script src="/dist_JsBarcode.all.min.js"></script>
    <script src="qrcode/qrcode.min.js"></script>
</head>

<body>
<!--<div class="printBox">-->

<!--</div>-->
<div style="width:1007px; ">
<!--startprint-->
<div style="font-size: 12pt;width:1007px;margin-left: 100px">
    <div style="width:1007px;margin-left:15%;font-size:20pt;font-weight:900;margin-top:50px;">山东大学附属儿童医院&nbsp;&nbsp;&nbsp;&nbsp;济南市儿童医院</div>
    <div><span style="font-size:20pt;font-weight:900;margin-left:35%;margin-top:7px;"> 检&nbsp;验&nbsp;报&nbsp;告&nbsp;单</span>
        <!--<span style="float:right;font-size:13pt;font-weight:bold;margin-top:10px;margin-right: 180px;">质评合格 全省参考</span>-->
    </div>
    <div id="qrcode" style="width: 100px;height: 100px;position: absolute;left: 999px;top: 45px;"></div>
    <div style="margin-top:43px;font-size: 12pt"><span> 姓名:</span><span id="baogaoName"></span><span
            style="margin-left:50px;"> 性别:</span><span id="baogaoSex"></span><span style="margin-left:49px;"> 年龄:</span><span  id="baogaoAge"></span><span
            style="margin-left:52px;"> 标本类型:</span>
        <span>咽拭子</span><span style="margin-left:50px;"> 身份证号:</span><span  id="baogaoIdcard"></span></div>
    <div style="border-bottom: #000000 1px solid;width: 100%;height: 9px;margin-top:-3pt;"></div>
    <div style="margin-top:12px;display:inline-block;width:1007px;font-weight: bold;"><span> 序</span><span
            style="margin-left:7%">代号</span><span style="margin-left:8%"> 项目名称</span>
        <span style="margin-left:11%">结果</span><span style="margin-left:11%">
			参考范围</span><span style="margin-left:9%">单位</span></div>
    <div style="border-bottom: #000000 1px solid;width: 100%;height: 9px;margin-top:-5pt;"></div>
    <div style="height:180px;">
        <div style="margin-top:15px;display:inline-block;width:1007px;"><span> 1</span><span
                style="margin-left:6%">2019-nCov</span><span style="margin-left:4%" id="baogaoProject"> </span>
            <span style="margin-left:4%" id="baogaoResult"></span><span style="margin-left:12%">
			阴性</span><span style="margin-left:10%"></span></div>
    </div>
    <div style="border-bottom: #000000 1px solid;width: 100%;height: 14px;"></div>
    <div style="margin-top:15px;"><span class="stl_26 stl_08 stl_29" style="word-spacing:0.3692em;">接收时间：</span><span id="baogaoSignDate"> &nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;<span>报告时间：</span><span id="baogaoSignDate2"> &nbsp;</span>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>检验者：张豪正&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审核者: 刘毅</span>
    </div>

    <div style="margin-top:15px;"><span>本检测报告可能受到采样时间、采样部位及方法学局限性等因素的影响，结果需结合临床进行分析。</span> </div>
    <div style="margin-top:15px;"><span>本报告仅对本次检测标本负责。 &nbsp;</span></div>
</div>
<!--endprint-->
    <input id="waterId" type="hidden">
    <input type="button" class="button1" value="打印" onclick="print_page()"></div>
</div>

<script>

    window.onload = function() {
        var reg = new RegExp("(^|&)waterId=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            var   waterid = unescape(r[2]);
        console.log(waterid)
        document.getElementById("waterId").value=waterid;
        var prints = window.sessionStorage.getItem("print"+waterid);
        var fapiaoInfo = JSON.parse(prints);
        console.log(fapiaoInfo);
        console.log(fapiaoInfo.name);
        var sex = fapiaoInfo.sex;
        if(sex==0){
            sex='男';
        }else if(sex==1){
            sex=='女';
        }
        document.getElementById("baogaoName").innerHTML=fapiaoInfo.name;
        document.getElementById("baogaoSex").innerHTML=sex;
        document.getElementById("baogaoAge").innerHTML=fapiaoInfo.mapTemp.age;
        document.getElementById("baogaoIdcard").innerHTML=fapiaoInfo.idcard;
        document.getElementById("baogaoSignDate").innerHTML=fapiaoInfo.createTime;
        document.getElementById("baogaoSignDate2").innerHTML=fapiaoInfo.returnDate;
        document.getElementById("baogaoProject").innerHTML=fapiaoInfo.project;
        document.getElementById("baogaoResult").innerHTML=fapiaoInfo.projectResult;
        makeCode(fapiaoInfo.uuid);
    }
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 100,
        height : 100
    });
    function makeCode (elText) {

        if (!elText) {

            return;
        }

        qrcode.makeCode(elText);
    }
</script>


</body>

<script type="text/javascript">
    function print_page() {
        if (!!window.ActiveXObject || "ActiveXObject" in window) { //是否ie
            remove_ie_header_and_footer();
        }
        bdhtml = window.document.body.innerHTML;
        var oldstr = document.body.innerHTML;
        sprnstr = "<!--startprint-->";
        eprnstr = "<!--endprint-->";
        prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
        prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
        prnhtml=prnhtml.replace("999","890");
        window.document.body.innerHTML = prnhtml;
        console.log(prnhtml);
        window.print();
        document.body.innerHTML = oldstr;

    }

    function remove_ie_header_and_footer() {
        var hkey_path;
        hkey_path = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
        try {
            var RegWsh = new ActiveXObject("WScript.Shell");
            RegWsh.RegWrite(hkey_path + "header", "");
            RegWsh.RegWrite(hkey_path + "footer", "");
        } catch (e) {
        }
    }

   /* print_page()*/
</script>
</html>
